home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aab.d64
/
proc.test'signal
< prev
next >
Wrap
Text File
|
2007-02-28
|
1KB
|
41 lines
0010 ╨╥╧├ TEST'SIGNAL(TYPE#,FREQ,CYCLE,╥┼╞ SAMPLE(),N#) ├╠╧╙┼─
0020 // BY ╘OM ╦UIPER 1985
0025 //
0030 // ─ERIVES A SERIES SAMPLES FROM
0040 // OSCILLATOR THREE OF THE SOUND
0050 // INTERFACE DEVICE (SID).
0055 //
0060 // ┴ 205 HZ WAVEFORM IS SAMPLED
0070 // AT THE ╬YQUIST FREQUENCY,
0080 // I.E. WITH 2 SAMPLES PER CYCLE.
0090 // TYPE# : 0-TRIANGLE,
0100 // 1-TRIANGLE, 2-SAWTOOTH, 4-PULSE
0110 // ╞ORMS MAY BE LOGICALLY ┴╬─ED
0120 // BY SUMMING THESE VALUES:
0130 // FREQ : FREQUENCY IN HZ
0140 // CYCLE : PULSE DUTY CYCLE IN %
0150 // F'TYPE#: 1-LOW PASS,
0160 // 2-BANDPASS,
0170 // 3-HIGH PASS FILTER
0180 // F'FREQ : FILTER CUTOFF OR
0190 // CENTER FREQUENCY IN HZ
0200 // SAMPLE : OUTPUT ARRAY
0210 // N# : NUMBER OF SAMPLES
0220 //
0230 ╒╙┼ SOUND
0240 SID:=$D400
0250 FR:=FREQ*16.77722
0260 SETFREQUENCY(3,FR)
0270 PW:=CYCLE*40.95
0280 PULSE(3,PW)
0290 VOLUME(15)
0300 ╔╞ TYPE#=0 ╘╚┼╬
0310 SOUNDTYPE(3,4)
0320 ┼╠╙┼
0330 ╨╧╦┼ SID+$12,16*TYPE#
0340 ┼╬─╔╞
0350 ╞╧╥ I#:=0 ╘╧ N#-1 ─╧
0360 SAMPLE(I#):=OSC3
0370 ┼╬─╞╧╥ I#
0380 ┼╬─╨╥╧├ TEST'SIGNAL